/**
 * <p>Title: ServiceZMCEF9.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 张志芳
 * @version 1.0
 * <pre>Histroy:
 *          2012-1-17 上午10:05:46  张志芳  Create
 *</pre>
 */
package com.baosight.sczx.zm.ce.service;

import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.ep.ServiceEPBase;
import com.baosight.sczx.common.zm.basetools.StaticTools;
import com.baosight.sczx.common.zm.cInterface.cs.InitialData;
import com.baosight.sczx.zm.ce.domain.ZMCEAccidentRecord;

/**
 * 事故记录
 * <p>Title: ServiceZMCEF9.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 张志芳
 * @version 1.0
 * <pre>Histroy:
 *          2012-1-17 上午10:05:46  张志芳  Create
 *</pre>
 */
public class ServiceZMCEF9 extends ServiceEPBase {
	/**
	 * 初始化方法
	 * <p>Function: initLoad</p>
	 * <p>Description: </p>
	 * <p>return value: ServiceZMCEAccidentRecord</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-4-8上午09:57:14 张志芳
	 * </p>
	 *
	 */
	public EiInfo initLoad(EiInfo inInfo) {
		inInfo.addBlock(EiConstant.resultBlock).set("showCount", "true");//如果不加这个，翻页的统计和显示是错误的
		EiInfo outInfo = this.query(inInfo);
		outInfo.addBlock(InitialData.getInstance().getEiBlockByNo("cmes.ce.accidentType", false));//事故类型
		return outInfo;
	}

	/**
	 * 查询
	 * <p>Function: query</p>
	 * <p>Description: </p>
	 * <p>return value: ServiceZMCEAccidentRecord</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-1-26下午04:23:36 张志芳
	 * </p>
	 *
	 */
	@Override
	public EiInfo query(EiInfo inInfo) {
		String fdEquipmentId = inInfo.getString("fdEquipmentId");
		StaticTools.setQueryParameters(inInfo, "fdEquipmentId", fdEquipmentId, true);//添加查询条件	
		EiInfo outInfo = super.query(inInfo, "ZMCEAccidentRecord.query", new ZMCEAccidentRecord());

		return outInfo;
	}
	
	
}
